(message "\n\n\nKRSNAke v1.15\n\n 1995 by Psilocybe Software\n\n"
         "This program is released under the GNU General Public License. "
         "See the accompanying file 'COPYING' for details.")

(message "\nWARNING:\n\nThis is a BETA release of KRSNAke; while it has proven "
         "stable enough for release, it is expected that some bugs still remain. "
         "If you encounter any, please notify the author at e-mail address "
         "stokke@telepost.no. The author naturally takes no responsibility for "
         "damage or loss of data caused by bugs in KRSNAke. That said, it isn't "
         "like KRSNAke will fry your CPU or anything. This is a STABLE beta "
         "release...\n\nGood luck!")

(welcome "This program is released under the GNU General Public License. "
         "See the accompanying file 'COPYING' for details.\n")

(set @default-dest (tackon
                        (askdir
                            (prompt "Select a location for the KRSNAke directory")
                            (help @askdir-help)
                            (default "Work:")
                        ) "KRSNAke")
)

(set copy-docs (askbool (prompt "\n\n\n\n\nDo you want to install the documentation?")
                        (help @askbool-help))
)

(set languages (askoptions
                    (prompt "Which language catalogs do you want to install?")
                    (help @askoptions-help)
                    (choices "kEwL"
                             "Norsk"
                             "Politically Correct")
                    (default 0)
               )
)

(makedir @default-dest (infos))

(working "\n\nInstalling KRSNAke...")

(copyfiles (source "KRSNAke")
           (dest @default-dest)
           (infos)
           (prompt "Copying KRSNAke executable...")
           (help @copyfiles-help)
)
(copyfiles (source "KRSNAkePrefs")
           (dest @default-dest)
           (infos)
           (prompt "Copying KRSNAke Prefs Editor...")
           (help @copyfiles-help)
)

(copylib (source "Libs/krsnake.library")
         (dest "LIBS:")
         (prompt "Copying libraries...")
         (help @copylib-help)
)
(copylib (source "Libs/gtlayout.library")
         (dest "LIBS:")
         (prompt "Copying libraries...")
         (help @copylib-help)
)
(copylib (source "Libs/player61.library")
         (dest "LIBS:")
         (prompt "Copying libraries...")
         (help @copylib-help)
)
(copylib (source "Libs/protracker.library")
         (dest "LIBS:")
         (prompt "Copying libraries...")
         (help @copylib-help)
)

(makedir (tackon @default-dest "Clients"))

(copyfiles (source "Clients")
           (dest (tackon @default-dest "Clients"))
           (infos)
           (all)
           (confirm "average")
           (prompt "Copying KRSNAke clients...")
           (help (cat "  Action Replay\n\nThis client records your games and "
                      "offers you the possibility of replaying them at any speed.\n\n"
                      "  Hall Of Fame\n\nThis client provides you with a high score "
                      "table.\n\n" @copyfiles-help))
)

(copyfiles (source "Rexx")
           (dest (tackon @default-dest "Rexx"))
           (infos)
           (all)
           (confirm "average")
           (prompt "Copying ARexx scripts...")
           (help @copyfiles-help)
)

(if (exists "Graphics")
    (copyfiles (source "Graphics")
           (dest (tackon @default-dest "Graphics"))
           (infos)
           (all)
           (confirm "average")
           (prompt "Copying graphics...")
           (help @copyfiles-help)
    )
)

(if (exists "Sound")
    (copyfiles (source "Sound")
           (dest (tackon @default-dest "Sound"))
           (infos)
           (all)
           (confirm "average")
           (prompt "Copying sound samples...")
           (help @copyfiles-help)
    )
)

(if (in languages 0) (
    (if (not (exists "LOCALE:Languages/kewl.language"))
        (copyfiles (source "Languages/kewl.language")
                   (dest "LOCALE:Languages")
                   (prompt "Copying KeW language file...")
                   (help @copyfiles-help)
        )
    )
    (copyfiles (source "Catalogs/kewl")
               (dest "LOCALE:Catalogs/kewl")
               (all)
               (prompt "Copying fcKiN KeW catalog...")
               (help @copyfiles-help)
    )
))

(if (in languages 1)
    (copyfiles (source "Catalogs/norsk")
               (dest "LOCALE:Catalogs/norsk")
               (all)
               (prompt "Copying norwegian catalog...")
               (help @copyfiles-help)
    )
)

(if (in languages 2) (
    (if (not (exists "LOCALE:Languages/pce.language"))
        (copyfiles (source "Languages/pce.language")
                   (dest "LOCALE:Languages")
                   (prompt "Copying politically correct language file...")
                   (help @copyfiles-help)
        )
    )
    (copyfiles (source "Catalogs/pce")
               (dest "LOCALE:Catalogs/pce")
               (all)
               (prompt "Copying politically correct catalog...")
               (help @copyfiles-help)
    )
))

(if copy-docs (
        (makedir (tackon @default-dest "Docs"))
        (copyfiles (source "Docs")
                   (dest (tackon @default-dest "Docs"))
                   (infos)
                   (all)
                   (confirm "average")
                   (prompt "Copying documentation...")
                   (help @copyfiles-help)
        )
    )
)

(if (exists "Src")
    (if (<> user-level "novice")
        (if (askbool (prompt "\n\n\n\n\nDo you want to install the source code (in Amiga-E; Hail Wouter!) and developer information?")
                     (help @askbool-help))
            (
                (makedir (tackon @default-dest "Src"))
                (copyfiles (source "Src")
                           (dest (tackon @default-dest "Src"))
                           (infos)
                           (all)
                           (prompt "Copying source code...")
                           (help @copyfiles-help)
                )
            )
        )
    )
)

(exit "\nRemember:\n\nBug reports go to\n\nstokke@telepost.no")
